home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 109_01.zip / TYP.C < prev    next >
Text File  |  1993-06-26  |  1KB  |  31 lines

  1.  /*  This program will simply display an ASCII file on the
  2. console using as large a buffer as possible.  When I TYPE a
  3. long file the constant disk accessing drives me crazy! This
  4. allows me to examine the file in peace!  NB*128 is the
  5. buffer size in bytes.  Make it as large as possible for your
  6. system. Here it is used as a 32K bufsize.
  7. */
  8. #define NB 256    
  9. #define CPMEOF -1
  10. #define EOF 26
  11. #define CR 13
  12. char ibuf[NB*128+8];
  13. main (argc, argv)
  14. char **argv;
  15. int fd,c,argc;
  16. {
  17.     fd = FOpenBig (argv[1],ibuf,NB);
  18.     if (fd == -1)  {
  19.         printf("\nCan't open file ! ");
  20.         exit ();
  21.     }
  22.     while ((c = GetcBig(ibuf)) != EOF && c != CPMEOF)    {
  23.         if (c == CR)
  24.             continue;
  25.         else
  26.         putchar(c);
  27.     }
  28.     close(fd);
  29.     exit();
  30. }
  31.